package sqlbuffer;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;


public class testDriver {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		/* Write into File for checking Start*/
        File fOut = new File("D:\\getMediaBuyGoogleClickBreakDownByKeywordsWithSorting.txt");
        File fIn = new File("D:\\getMediaBuyGoogleClickBreakDownByKeywordsWithSorting.SQL");
        FileWriter fw = null;
        FileReader fr = null;
        String s;
        String sOut = "";
        try {
        	fr = new FileReader(fIn);
            BufferedReader br=new BufferedReader(fr);
			while ((s = br.readLine()) != null) {
				sOut = sOut + "sb.append(\"" + s + "\\n\");\n";
			}
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}finally{
			if(fr != null){
				try {
					fr.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

        
        try {
        	String sql = sOut;
			fw = new FileWriter(fOut);
			fw.write(sql);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally{
			if(fw != null){
				try {
					fw.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		/* Write into File for checking End*/
	}

}
